Repository navigation
Conversation
Retry callbacks need to stop another attempt when it cannot meet the workload's deadline. Treating AirflowFailException as an ordinary callback error can repeat expensive work after the callback has rejected a retry. Related: apache#60172. Signed-off-by: Deepak Jain <deepujain@gmail.com>
deepujain
force-pushed
the
fix-60172-retry-callback-failure
branch
from
November 8, 2026 07:25
d102572 to
fd3c0ad
Compare
deepujain
marked this pull request as ready for review
November 8, 2026 07:30
deepujain
requested review from
amoghrajesh,
ashb and
jason810496
as code owners
November 8, 2026 07:30
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Title: Stop retries when the retry callback raises AirflowFailException
Summary
A retry callback can decide that another attempt would be too late or too costly. Raising
AirflowFailExceptionthere currently logs a callback error and retries the task anyway. This change lets the callback stop retries and run normal failure handling with the original task exception.Changes
Retry callbacks run before the task outcome is reported. If one raises
AirflowFailException, the remaining retry callbacks stop; the failure callback, listener and failure email see the original task failure. Ordinary callback errors still allow retries.The supervisor starts its existing finalization timeout before the retry callback runs and retains the original retry payload until an outcome arrives. If the callback process exits early, that payload remains available; an explicit outcome or server termination takes precedence. The schema snapshots and generated Go/TypeScript consumers include the new message.
Related: #60172. Earlier attempts #60415, #64198, #66781 and #73849 closed without merging; #63342 was an empty closed PR. This patch addresses the retry-callback case. Losing a final outcome message remains a separate recovery limitation.
Test plan
UP_FOR_RETRY, and passes with this patch. An ordinary callback error remains a retry.dag.test()replay: the stopping callback fails after attempt 1; an ordinary callback error allows attempt 2; a task raisingAirflowFailExceptiondirectly fails after attempt 1.breeze testing core-testswith the selected non-DB groups: 5,714 passed, 11 skipped, 2 expected failures. All six selected SQLite DB groups also passed: 12,846 passed, 92 skipped.prekchecks passed, including type checks and generated-schema checks. Explicitprek run mypy-providers --stage manual --all-filesalso passed.go test ./...andgo test -race ./...passed. TypeScript SDK: 961 tests passed.TESTCONTAINERS_HOST_OVERRIDE=host.docker.internal; Ryuk remained enabled. The original broad invocation was not green.The full SDK suite, configured Dag replay and benchmark ran before the latest provider-only base refresh. The Task SDK sources, issue diff and resolved dependency versions are unchanged by that refresh; the provider-registration smoke suite above ran afterward.
Finalization cost
A local MsgPack socket benchmark alternated five base/candidate runs of 5,000 iterations with a no-op callback. The extra supervision message adds about 11.5 microseconds to retry finalization with a callback. It lets the callback decide the outcome while preserving bounded finalization. The unchanged parsing control moved 3.5%, below the documented 10% noise threshold.
closes: #60172
Was generative AI tooling used to co-author this PR?
Generated-by: OpenAI Codex following the guidelines